package main

import "fmt"

/*
*
声明结构体
*/
type Address struct {
	name    string
	street  string
	city    string
	state   string
	Pincode int
}

type Address1 struct {
	name, street, city, state string
	Pincode                   int
}

func main() {

	var a = Address{"hello", "world", "北京", "良好", 18}

	fmt.Println(a.name)
	fmt.Println(a.street)
	fmt.Println(a.city)
	fmt.Println(a.state)
	fmt.Println(a.Pincode)

	// 指向结构体指针
	add := &Address{
		"hello",
		"world",
		"北京",
		"良好",
		18,
	}
	fmt.Println("first name:", (*add).name)

	fmt.Println("name:", add.name)
	fmt.Println("state:", add.state)

}
